// 导入joi验证规则
const joi = require('joi')

// 时间参数的验证规则
const createTime = joi.string().required()
// 点赞数的验证规则
const start = joi.number().min(0).required()
// 仅自己可见参数的验证规则
const visibility = joi.boolean().required()
// 内容参数的验证规则
const content = joi.required()
// id的验证规则
const id = joi.required()

exports.weite_dynamic_schema = {
  body: {
    createTime,
    start,
    visibility,
    content
  }
}

exports.delete_dynamic_schema = {
  body: {
    id
  }
}

exports.getById_dynamic_schema = {
  query: {
    id
  }
}

exports.update_content_schem = {
  body: {
    id,
    content,
    start,
    createTime
  }
}

exports.update_vb_schema = {
  body: {
    id,
    visibility
  }
}
